package com.corpgovernment.common.enums;

/**
 * @program: corpgovernment-common-logging
 * @description: 日志枚举级别
 * @author: wubing
 * @create: 2019-06-04 14:54
 */
public enum LogLevelEnum {

    Debug("Debug", 0),
    Info("Info", 1),
    Warn("Warn", 2),
    Error("Error", 3),
    Fatal("Fatal", 4);

    LogLevelEnum(String code, int value) {
        this.code = code;
        this.value = value;
    }

    public static LogLevelEnum getByCode(String code) {
        for (LogLevelEnum item : values()) {
            if (item.getCode().equalsIgnoreCase(code)) {
                return item;
            }
        }
        return Info;
    }

    private String code;
    private int value;

    public String getCode() {
        return code;
    }

    public int getValue() {
        return value;
    }
}
